﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace idataplatform
{
    public partial class jfchange : Form
    {
        public jfchange()
        {
            InitializeComponent();
        }

        private void jfchange_Load(object sender, System.EventArgs e)
        {
            conncls conns = new conncls();
            string jfchangeSQL = "SELECT hyno,phoneno,jftime,jftype,jfint,operator,jfmark FROM jfchange_ipark where jftime >= '" + DateTime.Now.Date.AddDays(-8).ToShortDateString() + "' AND jftime <= '" + DateTime.Now.Date.AddDays(-1).ToShortDateString() + "'";

            dataGridView1.DataSource = conns.Dts(jfchangeSQL);
            toolStripStatusLabel1.Text = dataGridView1.Rows.Count.ToString() + " 行";
        }

        private void 数据导出ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ExportExcel Et = new ExportExcel();
            Et.GridToExcel("招商蛇口佛山IPARK花园城积分变动数据", dataGridView1);
        }

        private void 条件查询ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            jfchangesel form2 = new jfchangesel();
            form2.ShowDialog();
            if (form2.DialogResult == DialogResult.OK)
            {
                if (pubcls.jfchgselSQL != "")
                {
                    conncls conns = new conncls();
                    dataGridView1.DataSource = conns.Dts(pubcls.jfchgselSQL);
                    toolStripStatusLabel1.Text = dataGridView1.Rows.Count.ToString() + " 行";
                }
            }
        }
    }
}
